package com.tjetc.view.impl;

import com.tjetc.pojo.dto.PayDTO;
import com.tjetc.utils.ScannerUtils;
import com.tjetc.view.PayCRUDPage;

/**
 * @Author: itda
 * @Date: 2024/5/13 11:36
 * @Description: PayCRUDPageImpl
 */
public class PayCRUDPageImpl implements PayCRUDPage {

    @Override
    public String save() {
        System.out.println("请输入要新增的支付方式:");
        return ScannerUtils.sc.next();
    }

    @Override
    public String delete() {
        System.out.println("请输入要删除的支付方式:");
        return ScannerUtils.sc.next();
    }

    @Override
    public PayDTO update() {
        System.out.println("请输入要修改前的支付方式:");
        String oldPayName = ScannerUtils.sc.next();
        System.out.println("请输入要修改后的支付方式:");
        String newPayName = ScannerUtils.sc.next();
        return PayDTO.builder().oldPayName(oldPayName).newPayName(newPayName).build();
    }
}
